<template>
	<view>
		<view v-for="(item,idx) in dataArray" :key="idx">{{item}}</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataArray: []
			}
		}, 
		onLoad(option) {
			this.getData("onLoad_",50)
		},
		onPullDownRefresh() {
			this.getData("下拉获取的数据_",10,1);
			uni.stopPullDownRefresh();
			uni.showToast({
				title:"下拉获取的数据完毕",
				icon:'success',
				duration:3000
			})
		},
		onReachBottom() {
			this.getData("上拉获取的数据_",10,0);
			console.log("shengmingzhouqi->onPullDownRefresh()");
			uni.showToast({
				title:"上拉获取的数据完毕",
				icon:'success',
				duration:3000
			})
		},
		methods: {
			getData(name,pageSize=30,fangxiang=0){
				for(let i=0;i<pageSize;i++ ){
					if(fangxiang==1){
						this.dataArray.unshift(name+i)
					}
					else{
						this.dataArray.push(name+i)
					}
				}
			}
		}
	}
</script>

<style>

</style>
